 package com.cxl.adt.stack;
 /* Location:           E:\work\eclipse3.6_\workspace\design_pattern\
  * Qualified Name:     com.cxl.adt.stack.Stack
  * JD-Core Version:    0.6.1
  */
 public class Stack
 {
   private int maxSize;
   private char[] stackArray;
   private int top;
 
   public Stack(int s)
   {
     this.maxSize = s;
     this.stackArray = new char[this.maxSize];
     this.top = -1;
   }
 
   public char push(char j)
   {
     return this.stackArray[(++this.top)] = j;
   }
 
   public char pop() {
     return this.stackArray[(this.top--)];
   }
 
   public char peek() {
     return this.stackArray[this.top];
   }
 
   public boolean isEmpty() {
     return this.top == -1;
   }
 
   public boolean isFull() {
     return this.top == this.maxSize - 1;
   }
 }

